package i5.atlas.xmpp.filetransfer;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import org.jivesoftware.smack.XMPPException;

 

/**
*
* @author ekakoll
*/
public class UserKovachev extends User {

 

    public void init() throws Exception {
        setUserName("kovachev");
        setPassword("kovachev");
        ssc = new SimpleSmackClient();
        ssc.login(this.getUserName(), this.getPassword());
    }

 

    public void sendMessage(String message, String destination) throws XMPPException, XMPPException {
        ssc.sendMessage(message, destination);
    }

 

    public void logout() {
        ssc.logout();
    }

 

    public void fileTransfer(String fileName, String destination) throws XMPPException {
        ssc.fileTransfer(fileName, destination);
    }

 

    public void fileReceiver(final boolean accept, final String fileName) {
        ssc.fileReceiver(accept, fileName);
    }

 

    public static void main(String[] args) throws Exception {
        UserKovachev uko = new UserKovachev();
        uko.init();

 

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String message = null;
//        while (!(message = br.readLine()).equalsIgnoreCase("bye")) {
            ssc.sendMessage("Kovachev send a message.", "dejan@gentileschi.informatik.rwth-aachen.de");
//
//        }

        // Receive new file. You can give it a new name
        uko.fileReceiver(true, "C:\\Dev\\xmpp-recev.txt");
 

//        uko.logout();
    }
}